<?php

return array(
    // 校验工具类规则初始化
    'VALIDATE_UTIL_CUSTOM_RULE' => array(
        // 修改错误提示
        'password' => array(NULL, NULL, '403,213,error'),
        'username' => array(NULL, NULL, '403,215,error'),
        'mobile' => array(NULL, NULL, '403,130,error'),
        'email' => array(NULL, NULL, '403,141,error'),
        'notempty' => array(NULL, NULL, '403,214,error'),
        'notnull' => array(NULL, NULL, '403,212,error'),
        'IDCard' => array('callback', 'validateIdCard', '403,208,error'),
        'natureNumber' => array(NULL, NULL, '403,213,error'),
        'integer' => array(NULL, NULL, '403,213,error'),
        'booleanInt' => array(NULL, NULL, '403,213,error'),
        'positiveInteger' => array(NULL, NULL, '403,213,error'),
        'moreNow' => array(NULL, NULL, '403,3391,error'),
        // 增加校验规则
        'vcode' => array('regex', '/^[a-zA-Z0-9]{4}$/', '403,121,error'),
        'vcode6' => array('regex', '/^\d{6}$/', '403,121,error'),
        'randomNumber' => array('regex', '/^\d{6}$/', '403,213,error'),
        'md5password' => array('regex', '/^[a-zA-Z0-9]{32}$/', '403,213,error'),
        // 增加时间格式校验规则
        'isHourMinute' => array('regex', '/^([0-1]?[0-9]|2[0-3]):([0-5][0-9])$/',
        'isDateTime' => array('function', array('checkTimeStrFormat', 'Y-m-d H:i:s'), '403,213,error')),
        'isDateTimeWithoutSecond' => array('function', array('checkTimeStrFormat', 'Y-m-d H:i'), '403,213,error'),
        'isDate' => array('function', array('checkTimeStrFormat', 'Y-m-d'), '403,213,error'),
        'timeformat_H:i' => array('function', array('checkTimeStrFormat', 'H:i'), '403,213,error'),
        'timeformat_Y-m-d H:i' => array('function', array('checkTimeStrFormat', 'Y-m-d H:i'), '403,213,error'),
        // ID检验
        'id' => array('regex', "/^\d{1,10}$/", '403,213,error'),
        'concatId' => array('regex', '/^(\d+,)*(\d+)$/', '403,213,error'),
        // 客栈相关校验
        'nameLength20' => array('mblength', '0,20,utf-8', '403,213,error'),
        'nameLength50' => array('mblength', '0,50,utf-8', '403,213,error'),
        'nameLength15' => array('mblength', '0,15,utf-8', '403,213,error'),
        'nameLength255' => array('mblength', '0,255,utf-8', '403,213,error'),
        'communityNumber' => array('regex', '/^\d{10}$/', '403,213,error'),
        // 价格校验
        'decimal8_2' => array('regex', '/^(-)?(\d{1,6})((\.\d{1,2})?)$/', '403,213,error'),
        'decimal9_6' => array('regex', '/^(\d{1,3})((\.\d{1,6})?)$/', '403,213,error'),
        // 房间相关校验
        
        // 订单相关校验
        'areaCode' => array('function', 'checkAreaCode', '403,216,error'),
        'mzOrder' => array('regex', '/^MZ\d{1,10}$/', '403,213,error'),

        // 优惠券相关校验
        'cpOrder' => array('regex', '/^CP\d{1,10}$/', '403,213,error'),
        'ucpOrder' => array('regex', '/^UCP\d{1,10}$/', '403,213,error'),
    )
);
